refactor unicsv & xcsv date time handling (#1114)
* refactor unicsv date time handling.
* restrict utc option range to match Qt offsetfromutc
* move xcsv from C-style legacy time to Qt.
* fill in lower order date/time fields when parsing.
* don't return date/time if we don't have one!
* enhance xcsv date/time testing, fix bug.
* csv format date time adjustements.
use QDateTime::fromString to parse iso date times.
return invalid QTime from addhms if parsing fails entirely.
* datetime display fixes.
For the xcsv writer:
avoid priting date/time fields when there isn't a valid date/time.
when printing with am/pm use times from a 12 hour clock.
add support for printing dotnet time.
use QDateTime::toString to print ISO time.
For the xcsv and unicsv readers:
use QDateTime::fromString instead of xml_parse_time when reading
ISO datetimes. This avoids xml_parse_times intentional odd behavior
of treating non-timezoned times as UTC.
add a test of the xcsv writer time related fields. This only runs
in America/Denver time zone. As setting the time zone is system
dependent the test only runs if tzselect is available. If so it
assumes America/Denver is available.
correct documentation to give a sensible format for xcsv field GMT_TIME.
* add reference files for new test.
* silence xcsv reader conversion warnings on empty strings.
* warn on parse errors reading excel time.
* xcsv date/time fixes.
fix addhms to account for 12/24 hour clock.
don't print invalid datetimes with iso_time, iso_time_ms.
add testcases to exercise all the xcsv reader date/time flavors.
* clarify HMSL, HMSG wrt 12/24 hour clocks.
* add missing reference file.
* enhance xcsv for HMS[L|G] before or after [LOCAL|GMT]_TIME
* restore YYYYYMMDD to use UTC.
This has been broken for some time. Mail from 2012 indicates the intent
was UTC (https://sourceforge.net/p/gpsbabel/mailman/message/
29544538/)
* unicsv review catches
don't ripple into trouble with msec rounding.
pass outputs that may or may not be written as references.
* retire xcsv fields HMSG_TIME, HMSL_TIME.
This is potentially a user visible change. It could require
users to rewrite any style files they have created that use
these fields.
These are replaced by repeated use of GMT_TIME and LOCAL_TIME.
This eliminates our pain over 12/24 hour clock issues. strptime/
strftime (as well as QTime) have distinct conversion specifiers
for hours with 12/24 hour clocks. Our support for HMSG_TIME,
HMSL_TIME used integer conversion specifiers for hours, minutes
and seconds. This made it difficult to decide if a 12 or 24 hour
clock should be used, and made it impossible to have reduced
precision values with 12 hour clock using an AM/PM designation.
We also always printed AM/PM designations.
* fix whitespace in serialization reference file